{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
<!-- {load href="__PLUGINS__layui/layui.js"}
{load href="__PLUGINS__layui/css/layui.css"} -->
<style type="text/css">
    #des,#des input{ width: 40px;text-align:center;}
    #id{ width: 78px; }
    .bs-checkbox{ width: 36px; height: 40px }
    .fixed-table-toolbar .columns,.fixed-table-toolbar .search{margin-left:0px; margin-top: 0px }
    #title span{ float: right; }
    .asdlkjasd{ background: #1ab394; color: #fff}
    .ibox-content {
        clear: both;
        overflow-x: auto;
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        {if condition='isset($next) && $next'}
        {else /}
        <div class="">
            <a onclick="add('{:url(\'addwithdraw\',[\'url\'=>-1])}')" href="javascript:void(0);" class="btn btn-primary ">申请提现</a>
        </div>
        <script type="text/javascript">
            function add(url){
                layer.open({
                    type: 2,
                    title: '提示',
                    shadeClose: false,
                    shade: 0.2,
                    area: ['90%', '90%'],
                    skin:'shangchuantup',
                    shift:-1,
                    content: url,
                    scrollbar: false,
                    moveType: 1,
                    moveOut: true
                });
            }
        </script>
        {/if}
        <div class="ibox-content">
            {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="fixed-table-toolbar" style="text-align: center;margin-bottom: 20px">
                        <h2>总提现: <font color="#1ab394">{$sum}</font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本月提现: <font color="#1ab394">{$month}</font></h2>
                    </div>

                    <div class="fixed-table-toolbar">
                        <a class="btn btn-default btn-outline {present name='paymethod'}{else /}asdlkjasd{/present}" href="{:url('withdraw')}{present name='state'}/state/{$state}{/present}{present name='next'}/next/{$next}{/present}">全部</a>
                        <a class="btn btn-default btn-outline {eq name='paymethod' value='0'}asdlkjasd{/eq}" href="{:url('withdraw',['paymethod'=>0])}{present name='state'}/state/{$state}{/present}{present name='next'}/next/{$next}{/present}">微信</a>
                        <a class="btn btn-default btn-outline {eq name='paymethod' value='1'}asdlkjasd{/eq}" href="{:url('withdraw',['paymethod'=>1])}{present name='state'}/state/{$state}{/present}{present name='next'}/next/{$next}{/present}">支付宝</a>
                    </div>
                    <div class="fixed-table-toolbar">
                        <a class="btn btn-default btn-outline {present name='paymethod'}{else /}asdlkjasd{/present}" href="{:url('withdraw')}{present name='paymethod'}/paymethod/{$paymethod}{/present}{present name='next'}/next/{$next}{/present}">全部</a>
                        <a class="btn btn-default btn-outline {eq name='state' value='0'}asdlkjasd{/eq}" href="{:url('withdraw',['state'=>0])}{present name='paymethod'}/paymethod/{$paymethod}{/present}{present name='next'}/next/{$next}{/present}">审核</a>
                        <a class="btn btn-default btn-outline {eq name='state' value='1'}asdlkjasd{/eq}" href="{:url('withdraw',['state'=>1])}{present name='paymethod'}/paymethod/{$paymethod}{/present}{present name='next'}/next/{$next}{/present}">通过</a>
                        <a class="btn btn-default btn-outline {eq name='state' value='2'}asdlkjasd{/eq}" href="{:url('withdraw',['state'=>2])}{present name='paymethod'}/paymethod/{$paymethod}{/present}{present name='next'}/next/{$next}{/present}">驳回</a>
                    </div>
                    <div style="display:block;clear: both;"></div>
                    <div class="fixed-table-toolbar">
                        <form  method="get" action="" style="display: flex;">
                            <div class="pull-left search" style="display: flex;">
                                <div class="columns columns-right btn-group pull-left">
                                    <select class="form-control" name="search">
                                        <option value="userid" {php}if(input('?param.search')){if(input('param.search')=='userid'){echo "selected";} }{/php}>账户ID</option>
                                    </select>
                                </div>
                                <div class="pull-right search">
                                    <input class="form-control input-outline" type="text"
                                           {php}
                                           if(input('?param.name')){
                                    if(input('param.name')){
                                    echo "value='".input('name')."'";
                                    }

                                    }
                                    {/php}
                                    name="name" placeholder="搜索">
                                </div>

                                <div class="pull-right search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px" class="btn btn-default btn-outline" type="submit">搜索</button>
                                </div>

                                <input name="start" type="text" id="start" class="form-control layui-input" value="{present name='start'}{$start}{/present}" placeholder=" # 起始时间" autocomplete="off" style="height:34px;width:100px;margin:0 10px;">
                                <input name="end" type="text" id="end" class="form-control layui-input" value="{present name='end'}{$end}{/present}" placeholder=" # 结束时间" autocomplete="off" style="height:34px;width:100px;margin:0 10px;">

                                {php}
                                if(input('?param.name')){
                                {/php}
                                <div class="pull-right search">
                                    <a class="btn btn-w-m btn-link" href="{:url('withdraw')}{present name='paymethod'}/paymethod/{$paymethod}{/present}{present name='state'}/state/{$state}{/present}{present name='next'}/next/{$next}{/present}">返回提现管理</a>
                                </div>{php}
                                }
                                {/php}


                            </div>
                        </form>
                    </div>
                    <div class="example">
                        <form class="form-horizontal" method="post">
                            <table data-toggle="table">
                                <thead>
                                <tr>
                                    <th data-align="center">ID</th>
                                    <th data-align="center">用户ID</th>
                                    <th data-align="center">用户昵称</th>
                                    <!--<th data-align="center">积分</th>-->
                                    <th data-align="center">现金</th>
                                    <th data-align="center">提现方式</th>
                                    <th data-align="center">提现姓名</th>
                                    <th data-align="center">提现账号</th>
                                    <th data-align="center">提现进度</th>
                                    <th data-align="center">提现时间</th>
                                    <th data-align="center">到账时间</th>
                                    <th data-align="center">处理描述</th>
                                </tr>
                                </thead>
                                <tbody id="form">
                                {php}$hide=array('0'=>'<font color="#f00">禁止</font>','1'=>'<font color="#1ab394">正常</font>','2'=>'审核','3'=>'<font color="#f00">拒绝</font>');{/php}
                                {volist name="data" id="v"}
                                <tr id="id{$v.id}" class="class">
                                    <td>{$v.id}</td>
                                    <td>{$v.userid}</td>
                                    <td>{$v.name}</td>
                                    <!--<td>{$v.price}</td>-->
                                    <td>{$v.money}</td>
                                    <td>{if condition="$v.paymethod == 0"}微信{elseif condition="$v.paymethod == 1"}支付宝{/if}</td>
                                    <td>{if condition="$v.paymethod == 0"}{$v.wxname}{elseif condition="$v.paymethod == 1"}{$v.zhifuname}{/if}</td>
                                    <td>{if condition="$v.paymethod == 0"}{$v.wxcount}{elseif condition="$v.paymethod == 1"}{$v.zhifucount}{/if}</td>
                                    <td>{if condition="$v.state == 0"}提现中{elseif condition="$v.state == 1"}提现成功{elseif condition="$v.state == 2"}提现失败{/if}</td>
                                    <td>{:date('Y-m-d H:i', $v.create_time)}</td>
                                    <td>{:date('Y-m-d H:i', $v.update_time)}</td>
                                    <td>{$v.reason}</td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}

<script type="text/javascript">

    layui.use(['laydate'], function(){
        var laydate = layui.laydate;
        var form = layui.form;

        laydate.render({
            elem: '#start' //指定元素
            ,type: 'date'
            ,trigger: 'click'
        });

        laydate.render({
            elem: '#end' //指定元素
            ,type: 'date'
            ,trigger: 'click'
        });
    })

    function del(id){
        swal_del(id,"{:url('tixiandel')}")
    }

    /*弹出层*/
    /*
        参数解释：
        title   标题
        url     请求的url
        id      需要操作的数据id
        w       弹出层宽度（缺省调默认值）
        h       弹出层高度（缺省调默认值）
    */
    function x_admin_show(title,url,w,h)
    {
        if (title == null || title == '') {
            title=false;
        };
        if (url == null || url == '') {
            url="404.html";
        };
        if (w == null || w == '') {
            w=($(window).width()*0.9);
        };
        if (h == null || h == '') {
            h=($(window).height() - 50);
        };
        layer.open({
            type: 2,
            area: [w+'px', h +'px'],
            fix: false, //不固定
            maxmin: true,
            shadeClose: true,
            shade:0.4,
            title: title,
            content: url,
            end: function (){
                window.location.reload();
            }

        });
    }

</script>
 